package string;

/**boolean startsWith(String s)
 * 判断当前字符串是否是以给定的字符串(s)开始的
 * boolean endsWith(String s)
 * 判断当前字符串是否是以给定的字符串(s)结束的
 *
 */
public class StartsWithDemo {
    public static void main(String[] args) {
        String str="thinking in java";
        boolean starts=str.startsWith("think");
        System.out.println(starts);
        boolean ends=str.endsWith("com");
        System.out.println(ends);

        String str1="asdfghjkl";
        boolean a=str1.startsWith("asd");
        boolean b=str1.endsWith("jkl");
        System.out.println(a);
        System.out.println(b);
    }
}
